Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.pacist.diamonds.SuperGridLayout
Field Summary | |
int | alignment
Alignment of components. |
int | cols
Number of columns. |
int[] | colWeights
Weights of all columns. |
int[] | colWidths
Widths of all columns. |
int | fill
Fill of components. |
int | hGap
Horizontal gap between components. |
int | hMargin
Horizontal margin between components. |
int[] | rowHeights
Heights of all rows. |
int | rows
Number of rows. |
int[] | rowWeights
Weights of all rows. |
int | vGap
Vertical gap between components. |
int | vMargin
Vertical margin between components. |
Constructor Summary | |
SuperGridLayout()
Creates and initializes a new SuperGridLayout object, with 1 column and a horizontal and vertical gap of 2. |
|
SuperGridLayout(int rows,
int cols)
Creates and initializes a new SuperGridLayout object with the specified number of rows and columns, and vertical and horizontal gaps of 2. |
|
SuperGridLayout(int rows,
int cols,
int hGap,
int vGap)
Creates and initializes a new SuperGridLayout object with the specified number of rows and columns, and horizontal and vertical gaps. |
|
SuperGridLayout(int rows,
int cols,
int hGap,
int vGap,
int hMargin,
int vMargin)
Creates and initializes a new SuperGridLayout object with the specified number of rows and columns, horizontal and vertical gaps, and horizontal and vertical margins. |
Method Summary | |
void | addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Adds the specified named component to the layout. |
void | calcCellSizes(java.awt.Container target)
Calculates the sizes of each of the cells in the specified Container. |
int | getAlignment()
Returns the current alignment for the components. |
int | getColumns()
Returns the current number of columns. |
int | getColWeight(int col)
Returns the weight of a given column. |
int | getFill()
Returns the current fill for the components. |
int | getRows()
Returns the current number of rows. |
int | getRowWeight(int row)
Returns the weight of a given row. |
void | layoutContainer(java.awt.Container target)
Lays out the specified container. |
java.awt.Dimension | minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions needed to layout the components contained in the specified target container. |
java.awt.Dimension | preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout given the components in the specified target container. |
void | removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout. |
void | setAlignment(int a)
Sets the alignment of the components. |
void | setColumns(int cols)
Sets the number of columns. |
void | setColWeight(int col,
int weight)
Sets the weight of a specific column. |
void | setFill(int f)
Sets the fill of the components. |
void | setRows(int rows)
Sets the number of rows. |
void | setRowWeight(int row,
int weight)
Sets the weight of a specific row. |
int | sumArray(int[] array,
int spacing,
int size)
Returns the total size of an array of heights/widths taking account of spacing and size. |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected int hGap
protected int vGap
protected int hMargin
protected int vMargin
protected int rows
protected int cols
protected int[] rowHeights
protected int[] colWidths
protected int[] rowWeights
protected int[] colWeights
protected int alignment
protected int fill
Constructor Detail |
public SuperGridLayout()
public SuperGridLayout(int rows, int cols)
public SuperGridLayout(int rows, int cols, int hGap, int vGap)
public SuperGridLayout(int rows, int cols, int hGap, int vGap, int hMargin, int vMargin)
Method Detail |
public void setColumns(int cols)
cols
- the number of columns.public void setRows(int rows)
rows
- the number of rows.public int getRows()
int
- the number of rows.public int getColumns()
int
- the number of columns.public void setAlignment(int a)
a
- the alignment.public int getAlignment()
int
- the current alignment.public void setFill(int f)
f
- the fill.public int getFill()
int
- the current fill.public void setRowWeight(int row, int weight)
row
- the row.
weight
- the new weight of the row.public void setColWeight(int col, int weight)
col
- the column.
weight
- the new weight of the column.public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
name
- the String name
comp
- the component to be addedpublic void removeLayoutComponent(java.awt.Component comp)
comp
- the component to be removedpublic java.awt.Dimension minimumLayoutSize(java.awt.Container target)
target
- the Container on which to do the layoutpublic java.awt.Dimension preferredLayoutSize(java.awt.Container target)
target
- the component which needs to be laid outpublic void layoutContainer(java.awt.Container target)
target
- the component being laid outprotected int sumArray(int[] array, int spacing, int size)
array
- the array of heights/widths.
spacing
- the margin to be added to each height/width.
size
- the number of items in the array to sum.int
- the summation of the array.protected void calcCellSizes(java.awt.Container target)
target
- the container.protected int getRowWeight(int row)
row
- the specified row.int
the weight of the row.protected int getColWeight(int col)
col
- the specified column.int
the weight of the column.Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |